import App from './App.vue'
import { createSSRApp } from 'vue'
import type { App as VueApp } from 'vue'
import pinia from '@/store/store'
import { getPlatformInfo } from './utils/platform'
import './assets/scss/global.scss'
import './assets/svg/iconfont-weapp-icon.scss'
// import * as socketApi from './utils/websocket'

export function createApp(): { app: VueApp } {
  const app: VueApp = createSSRApp(App)
  app.use(pinia)
  try {
    getPlatformInfo()
  } catch (error) {
    console.error('获取平台信息失败:', error)
  }
  // app.config.globalProperties.$socket = socketApi

  return { app }
}
